package com.yanxiaohui.springbootjdbc.controller;

import com.yanxiaohui.springbootjdbc.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description TODO
 * @Author： yanxh<br>
 * @Date 2019/11/7 10:46<br>
 * @Version 1.0<br>
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    UserService userService;

    @RequestMapping("/addUser/{userName}")
    public String addUser(@PathVariable String userName){
        return userService.addUser(userName) ? "success" : "fail";
    }
}

